package wk.demo.bean;

import android.content.Context;
import android.database.Cursor;
import android.support.v4.content.AsyncTaskLoader;

import java.io.File;

public class PathCursorLoader extends AsyncTaskLoader< DirFiles> {
    private File mPath;

    public PathCursorLoader(Context context, String path ) {
        super(context);
        mPath = new File(path).getAbsoluteFile();
    }


    // 子线程执行耗时操作
    @Override
    public DirFiles loadInBackground() {
        return new DirFiles(mPath    );
    }

    @Override
    protected void onStartLoading() {
        forceLoad(); //强制加载数据
    }


}
